<%inherit file="layout.mako"/>
<%!
  body_onLoad_script = "var elem = document.getElementById('feedback_leftby') || document.getElementById('feedback_subject'); elem.focus();"
%>
<h1>Submit Feedback</h1>
<p>Please tell us how we're doing. Suggestions? Compliments? Criticisms? It's all welcome.</p>
<form method="POST">
<table>
  <tr>
    <td>From:</td>
    % if req.session and req.session.has_key('user'):
    <td><a href="/people/${req.session.user}">${c.user and c.user.displayname or req.session.user}</a><input type="hidden" name="leftby" value="${req.session.user_email or req.session.user}"/></td>
    % else:
    <td><input id="feedback_leftby" type="text" size="40" name="leftby" value=""/></td>
    % endif
  </tr>
  <tr>
    <td>Subject:</td>
    <td><input id="feedback_subject" type="text" size="40" name="subject" value=""/></td>
  </tr>
  <tr>
    <td>What's on <br/>your mind?</td>
    <td><textarea class="wysiwyg" id="feedback_body" name="body" rows="10" cols="60"></textarea></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" value="Submit Feedback &raquo;"/></td>
  </tr>
</table>
</form>

<%def name="head_script_tags()">
  ## just include a simple wysiwyg editor in the feedback page - not the heavyweight one.
<script type="text/javascript" src="${c.site_uri}/js/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
  $(document).ready(function() {
    CKEDITOR.replace( 'feedback_body', {
        toolbar : 'Basic',
    });
  });
</script> 
</%def>